# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Thomas Dziedzic <gostrc@gmail.com>
# Contributor: Sergio A. Morales <sergiomorales@archlinux.cl>
# Contributor: soeren <nonick@posteo.de>

pkgname=gummi
pkgver=0.8.3
pkgrel=1
epoch=2
pkgdesc='Simple LaTeX editor'
arch=(loong64 x86_64)
url='https://github.com/alexandervdm/gummi'
license=(MIT)
depends=(gtksourceview3 gtkspell3 poppler-glib texlive-core)
makedepends=(git intltool setconf)
source=("git+$url#commit=0b204f0f50723dd8ff12dbee2b2129491178fab6") # tag: 0.8.2
b2sums=(SKIP)

prepare() {
  cd $pkgname
  ./autogen.sh
  setconf Makefile.in PACKAGE_VERSION "'"$pkgver"'"
  setconf data/misc/Makefile.in PACKAGE_VERSION "'"$pkgver"'"
  echo $pkgver > dev/latest
  autoreconf
  setconf configure PACKAGE_VERSION "'"$pkgver"'"
  setconf configure PACKAGE_STRING "'""Gummi $pkgver""'"
  setconf po/Makefile.in.in DATADIRNAME 'share'
}

build() {
  cd $pkgname
  ./configure --prefix=/usr
  make
}

package() {
  DESTDIR="$pkgdir" make -C $pkgname install
  install -Dm644 $pkgname/COPYING "$pkgdir/usr/share/licenses/$pkgname/COPYING"
}
